#ifndef MYGRAPHICITEM_H
#define MYGRAPHICITEM_H

#include <QGraphicsItem>
#include "../common.h"
class MyGraphicItem : public QGraphicsItem
{
public:
    explicit MyGraphicItem(QGraphicsItem *parent = nullptr);
    QRectF boundingRect() const override;
    //判断光标是否移动到了矩形上
    bool  bChangeCur(QPointF, MouseMoveDirect&);
signals:
protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
    // void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
    void focusOutEvent(QFocusEvent *event) override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    QRectF m_boundingRect; //边界
    QRectF m_bitemRect;    //矩形框大小
    //四个矩形小方块
    QRectF m_topRect;
    QRectF m_lefrRect;
    QRectF m_rightRect;
    QRectF m_bottomRect;
    bool   m_bSelect;
};

#endif // MYGRAPHICITEM_H
